package com.android.wlw_local.service;

import android.content.Context;

import com.farsunset.cim.sdk.android.CIMPushManager;
import com.farsunset.cim.sdk.android.model.SentBody;

/**
 * Created by zhuqin on 2018/1/28.
 */

public class SendUtils {

    /**
     * 登录
     * @param mContext
     * @param account
     * @param password
     */
    public static void loginSend(Context mContext , String account , String password){
        SentBody sentBody = new SentBody();
        sentBody.setKey("client_bind");
        sentBody.put("account",account);
        sentBody.put("location","2");
        sentBody.put("password",password);
        CIMPushManager.sendRequest(mContext,sentBody);
    }

    /**
     * 发送消息
     * @param mContext
     * @param msg
     */
    public static void sendMessage(Context mContext ,String msg){
        SentBody sentBody = new SentBody();
        sentBody.setKey("client_bind");
        sentBody.put("location","2");
        sentBody.put("message",msg);
        if(CIMPushManager.isConnected(mContext)) {
            CIMPushManager.sendRequest(mContext, sentBody);
        }
    }
}
